package com.example.loginregister.Model

import android.graphics.Rect

class DotModel(
    val num:Int,
    val cx:Float,
    val cy:Float,
    private val mRadius:Float,
    var state:DotState = DotState.Normal
) {
    fun containDot(x:Float,y:Float):Boolean{
        val rect = Rect((cx-mRadius/2).toInt(), (cy-mRadius/2).toInt(), (cx+mRadius/2).toInt(),
            (cy+mRadius/2).toInt()
        )
        return rect.contains(x.toInt(), y.toInt())
    }
}

enum class DotState{
    Normal,Selected,Error
}